package com.example.waterorder.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.waterorder.entity.Order;
import com.example.waterorder.dto.BuildingOrder;

import java.util.List;


public interface OrderService extends IService<Order> {
    public  Integer createOrder(Order order);

    public Order selectOrderByOrderId(String orderId);

    public List<Order> selectOrder(String building,Integer delivery);

    /**
     * 用户根据id查看自己的订单
     * delivery为空查询所有，delivery不为空查询对应状态的订单
     * @param userId
     * @param delivery
     * @return
     */
    public List<Order> selectOrderByUserId(String userId,Integer delivery);

    public List<BuildingOrder> selectBuildingOrderNotAccept(String lng,String lat);

    public List<BuildingOrder> selectBuildingOrderNotDelivery(String workerId,String lng,String lat);

    /**
     * 送水员查看订单
     * 都为空查询所有，任一不为空查询特定
     * @param building
     * @param delivery
     * @return
     */
    public List<Order> selectOrderByWorker(String workerId,String building, Integer delivery);

    /**
     * 送水员查询今日订单
     * @return
     */
    public List<Order> selectOrderToday(String workerId,String delivery);

    /**
     * 送水员查看水桶数
     * 都为空查询所有，任一不为空查询特定
     * @param building
     * @param delivery
     * @return
     */
    public Integer selectQuantity(String workerId,String building, Integer delivery);

    /**
     * 送水员查看今日售出且送达水桶数
     * @return
     */
    public Integer selectQuantityToday(String workerId);


    /**
     * 送水员查询今日营业额(已送达)
     * @return
     */
    public Double selectTodayAmount(String workerId);

    public Double selectWeeklyAmount(String workerId);

    public Double selectMonthlyAmount(String workerId);

    /**
     * 送水员查询总营业额(已送达)
     * @return
     */
    public Double selectTotalAmount(String workerId);


    /**
     * 修改订单
     * @param order
     * @return
     */
    public Integer updateOrder(Order order);
}
